package com.gc.cscott.verify.common;

import com.gc.cscott.verify.JavaTaskOutputVerifier;
import com.gc.cscott.verify.OutputVerifier.VerifiedOutput;
import com.google.common.base.Preconditions;

/**
 *
 * @author root
 */
public class EqualsVerifier implements JavaTaskOutputVerifier {

    public VerifiedOutput verify(String inputText, String outputText, String validationHintText) {
        Preconditions.checkNotNull(inputText);
        Preconditions.checkNotNull(outputText);
        Preconditions.checkNotNull(validationHintText);

        if (outputText.trim().equals(validationHintText.trim())==true){
            return VerifiedOutput.outputIsCorrect();
        } else {
            return VerifiedOutput.outputIsWrong("Presented '"+outputText.trim()+"' but expected '"+validationHintText.trim()+"'");
        }
    }

}
